
package com.koans.java.forloop;

/**
 * This koan explains creating an String array and assaining vales at the same time.
 * Using FOR loop and IFELSE conditions print the region in which the State code belongs
 * 
 * @author  Venkata Hari
 */

public class ForLoopDemo{


public ______- void main(String[] args)

{
 
String______  northEastStates = { "CT", "ME", "MA","NH","RI","VT", "NJ","NY","PA" };

String______ southEastStates = { "FT","GA","AR","NC","AL","LA","MS","VA","TN","KY","SC","WV" };

String______  midWestStates  =  { "IL","IN","IA","KS","MI","MN","MO","NB","ND","OH","SD","WI" };

String______ southWestStates = { "AZ","CA","CO","NV","NM","OK","TX","UT" };

String______ northWestStates  = { "OR","WA","ID","MT","WY","AK" };

/** Getting the parameter from the command line or user
 * 
 */

String userCode = args[_____];

//String stateCodes = { CT, ME,MA,NH,RI ,VT,NJ,NY,PA,FT,GA,AR,NC,AL,LA,MS,VA,TN,KY,SC,WV,IL,IN,IA,KS,MI,MN,MO,NB,ND,OH,SD,WI,AZ,CA,CO,NV,NM,OK,TX,UT,OR,WA,ID,MT,WY,AK};

/** This is a FOR loop statement in which we initialise the variable 
 * then making a  condition for it and incrementing the variable by 1
 *
 */

for(______ i=0; i<9; i++)
{

/** This is a IF conditional statement uses the equals() method from String class 
 * to compare the value of the String objects, as String cannot be compared
 *  with == operator 
 */
	
if ( userCode.equals(northEastStates[i]))
{
System._____.println("This State is in the North East Region");
}
}


_______(int i=0; i<12; i++)
{

if( userCode.equals(southEastStates[i]))
{
System.out.println("This state is in the South East States");
}
}


for(_______ i=0; i<12; i++)
{
________(userCode.equals(midWestStates[i]))
{
System.out.println("This State is in the Mid West Region");
}
}

for(int i=0; i<8; i++)
{
if(userCode.equals(southWestStates[i]))
{
System._______.println("This state is in the South West Region");
}
}

_______(int i=0; i<6; i++)
{
if(userCode.equals(northWestStates[i]))
{
System.out.println("This state is in the North West Region");
}
}


}
}





